package cn.edu.scau.cmi.lvmingyan.multition;

import cn.edu.scau.cmi.lvmingyan.singleton.Chairman;

public class Marshal 
{
	private String name;
	private static Marshal[] marshal = new Marshal[10];
	private static int number=0;
	
	private Marshal(String name) {
		setName(name);
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name=name;
	}

	public static Marshal getMarshal() {
		return marshal[number-1];
	}
	
	public static boolean createMarshal(String name) {
		if(number < 10) {
			//marshal[number].setName(name);
			marshal[number]=new Marshal(name);
			number++;
			return true;
		}
		return false;
	}

}
